//
//  TSNavigationController.m
//  AntMaintenance
//
//  Created by Seven Lv on 16/3/29.
//  Copyright © 2016年 Toocms. All rights reserved.
//

//static CGFloat kDistance = 80.0f;
#import "AppDelegate.h"
#import "TSNavigationController.h"
#import "UINavigationController+FDFullscreenPopGesture.h"

@interface TSNavigationController ()<UIGestureRecognizerDelegate>

@end

@implementation TSNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationBar.hidden = YES;
    self.fd_fullscreenPopGestureRecognizer.enabled = YES;
    self.interactivePopGestureRecognizer.enabled = YES;
    self.fd_fullscreenPopGestureRecognizer.delegate = self;
    [self.view addGestureRecognizer:self.fd_fullscreenPopGestureRecognizer];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {

//    if (self.viewControllers.count == 1) {
//                [super pushViewController:viewController animated:animated];
//            }
    if (self.viewControllers.count > 0) {
        TSLog(self.viewControllers.count);
        ///第二层viewcontroller 隐藏tabbar
        viewController.hidesBottomBarWhenPushed=YES;
    }
    [super pushViewController:viewController animated:animated];

}


+ (instancetype)naviWithRootViewController:(UIViewController *)aviewController {
    return [[self alloc] initWithRootViewController:aviewController];
}

@end
